routine |
1 | language documentation Operators |
1.1 | (Operators) prefix | |
2 | language documentation Operators |
2.1 | (Operators) infix | |
Documentation for routine |
assembled from the following types:
language documentation Operators
From Operators
(Operators) prefix |
Flattens objects of type Capture, Pair, List, Map and Hash into an argument list.
sub slurpee( |args );slurpee( <a b c d>, , 'e' => 'f' => 33 )# OUTPUT: «\(("a", "b", "c", "d"), {:e(3)}, :e(:f(33)))»
Please see the Signature
page, specially the section on Captures for more information on the subject.
Outside of argument lists, it returns a Slip, which makes it flatten into the outer list. Inside argument list Positional
s are turned into positional arguments and Associative
s are turned into named arguments.
language documentation Operators
From Operators
(Operators) infix |
multi sub infix:<|>(, --> Junction) is assoc<list>
Creates an any Junction from its arguments.
my = // | /<[i j k]>/ | /<[x y z]>/;say .perl; # OUTPUT: «any(/<[a b c]>/, /<[i j k]>/, /<[x y z]>/)»say 'b' ~~ ; # OUTPUT: «True»
This first creates an any
Junction
of three regular expressions (every one of them matching any of 3 letters), and then uses smartmatching to check whether the letter b
matches any of them, resulting in a positive match. See also Junction for more details.